/*
 * Controller.h
 *
 *  Created on: Apr 21, 2010
 *      Author: Soheil Damangir
 */

#ifndef CONTROLLER_H_
#define CONTROLLER_H_

namespace Group5 {

class PID_controller {
public:
  PID_controller(int _Kp, int _Ti, int _Td, int _dt);
  void feed(int n);
  int get_val();
  int next(int n);
  inline void setPoint(int _setpoint);
  virtual ~PID_controller();
private:
  const int dt, Td, Ti, Kp;
  int e0, e1, e2;
  int last;
  int set_point;
};

}

#endif /* PID_CONTROLLER_H_ */
